<?php

class PacienteController extends CI_Controller{
    public function index() {
        $this->loadDefaultData();
    }
    
    public function loadDefaultData(){
        $this->load->model('PatientModel');
        //$this->listAllPatients($this->PatientModel->getPatients());
        $this->load->view('view_pacientes');
    }
    
    public function listAllPatients($patients){
        $userPatients = $this->PatientModel->getUserPatients();
        echo count($userPatients);
        foreach($patients as $patient){
            foreach($userPatients as $userPat){
                if($userPat['ID_PACIENTE'] == $patient['ID_PERSONA']){
                    $patients['usuario'] = "YES";
                    break;
                }else{
                    $patients['usuario'] = "NO";
                }
            }
        }
        
    }
}

?>
